<?php $posts = $this->getPosts(); 
	$cat = $this->getCat();

$pageName= 'http://' . $_SERVER['SERVER_NAME'] . '/index.php/'
?>
<script language="javascript" type="text/javascript">
   var base_url_news = '<?php echo $pageName?>';
</script>
       <div class="newsevents">
         <div class="bg_top_y"><img src="<?php echo $this->getSkinUrl()?>images/contact_bg_top.gif"/></div>
         <div class="main">
            <div class="title_event">
                <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border1.png"/></div>
                <div class="title_c">
                   <span><?php echo $cat->getTitle()?></span>
                   <div class="select">
                       <div class="moni_s" onclick="CoLeeSelect3(this)" tabIndex=0 style="z-index:1">
                    <input id="attends" name="attends"  type="text" class="newsevents_iput_s " value="<?php if(!empty($_GET['s'])){echo $cat->getTitle();}else{echo 'Please Select';}?>" />
                    <ul  class="Option" style="border-top:medium none;display:none;left:0;list-style:none inside none;top:28px;width:290px;z-index:1000;">
                      <li id="news_s" class="" style="width:286px !important; float:left">Please Select</li>
                      <li id="news_s" class="" style="width:286px !important; float:left" urlkey="news?s=1">News & Events</li>
                      <li id="news_s" class="" style="width:286px !important; float:left" urlkey="news/cat/showdates?s=1">Show Dates</li>
                      <li id="news_s" class="" style="width:286px !important; float:left" urlkey="news/cat/dealer_news?s=1">Dealer News</li>
                      <li id="news_s" class="" style="width:286px !important; float:left" urlkey="news/cat/customer_updates?s=1">Customer Updates</li>
                      <li id="news_s" class="" style="width:286px !important; float:left" urlkey="news/cat/competitions?s=1">Competitions</li>
                    </ul>
                    </div>
                    
                    </div>
                </div>
                <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border1.png"/></div>
            </div>
            <?php 	$postcollection = Mage::getModel('news/news')->getCollection()
										->addStoreFilter(Mage::app()->getStore()->getId())
										->addCatFilter($cat->getCatId())
										->setOrder('created_time', 'desc');
								Mage::getSingleton('news/status')->addEnabledFilterToCollection($postcollection);
							$i=1;
							foreach ($postcollection as $post){
						?>
           <div class="car_list">
                <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border1.png"/></div>
                 <div id="downloadsexpand<?php echo $i?>" class="cars">
                    <h3 > <strong class="tt"><?php echo $post->getTitle()?> - <?php if($cat->getTitle()=='Useful Links'){?> <a href="http://<?php echo $post->getLinkUrl()?>" target="_blank"> <?php } else echo "";?><?php if ($post->getLinkUrl()){echo $post->getLinkUrl(); }?> <?php if($cat->getTitle()=='Useful Links'){?> </a> <?php }else echo "";?></strong>
                     <span style="overflow: visible;"  class="click">
                     <img class="question" src="<?php echo $this->getSkinUrl()?>images/question.png" alt="" width="17" height="17" />
                     <?php if($cat->getTitle()=='Useful Links')echo 'Click to expand links';else echo 'Click to expand this article';?><a style="" href="javascript:clickShowIcon('<?php echo $i?>');">  
                     <img class="sword" src="<?php echo $this->getSkinUrl()?>images/sworddown.png" alt="" width="31" height="31" /></a></span>
                     </h3>
                 </div>
					<div id="downloadsdetail<?php echo $i?>" style="display:none" class="hide_detail">
                   
                   <div  class="news"  style="display:block">
                  
                        <?php  if ($post->getLinkUrl()){ ?>
                             
                             <p><?php echo $post->getTitle()?> - <a href="http://<?php echo $post->getLinkUrl()?>"><?php echo $post->getLinkUrl()?></a></p>
                             
                        <?php } else {?>
                             
                             <p><?php echo $post->getTitle()?></p>
                        
                        <?php }?>
	                    <p ><?php if($cat->getTitle()=='Useful Links'){?><div style="width:500px;float:left;"><?php }?><?php echo $post->getPostContent()?><?php if($cat->getTitle()=='Useful Links'){?></div><?php }?></p>
                        <?php if($cat->getTitle()=='Useful Links'){
                        		if ($post->getNfile()){?>
                        <a href="http://<?php echo $post->getLinkUrl()?>" target="_blank" class="floatimg" >
                        <img src="<?php echo Mage::getBaseUrl('media');?><?php echo $post->getNfile();?>" alt="<?php echo $post->getTitle();?>" />
                        </a>
                        <?php } }?>
                        
                    <div  class="closebar" id="newsclosebar<?php echo $i?>">
                       <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border2.png"/></div>
                       <div class="closebar_c">
                           <div class="infor" style="display:none;">
                                <table  cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><img src="<?php echo $this->getSkinUrl()?>images/mark1.png"/></td>
                                    <td>0 mentions</td>
                                    <td><img src="<?php echo $this->getSkinUrl()?>images/retweet.jpg"/></td>
                                    <td><img src="<?php echo $this->getSkinUrl()?>images/like.jpg"/></td>
                                    <th>0</th>
                                  </tr>
                                </table>
                           </div>
                           <span style="overflow: visible;"  class="click">
                           <img class="question" src="<?php echo $this->getSkinUrl()?>images/question.png" alt="" width="17" height="17" />
                           <?php if($cat->getTitle()=='Useful Links')echo 'Close links &lt;';else echo 'Click to close this article';?><a style="" href="javascript:clickShowIcon('<?php echo $i?>');"> 
                            <img class="sword marginleft1" src="<?php echo $this->getSkinUrl()?>images/swordup.png" alt="" width="31" height="31" /></a></span>
                       </div>
                       <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border2.png"/></div>
                    </div>
                   </div>
                 </div>
                <div class="border1"><img src="<?php echo $this->getSkinUrl()?>images/border1.png"/></div>
            </div>
			<?php $i++;}?>	
	
         </div>
         <div class="bg_bottom_y"><img src="<?php echo $this->getSkinUrl()?>images/contact_bg_bottom.gif"/></div>
       </div>
<script type="text/javascript">

<!--

function clickShowIcon(id){
	
/*		for(i=1; i<=3;i++) {
			    document.getElementById("menu"+i).style.backgroundImage  = "url(http://energy.kaltesting.co.uk/skin/frontend/default/energy/images/a_2_bg.jpg)";
			    document.getElementById("menu"+i).style.backgroundRepeat = "no-repeat";
			    document.getElementById("menu"+i).style.backgroundPosition  = "0 25px";
				document.getElementById("menu"+i).style.color ="#8B8B8B";
				
				}

			    document.getElementById("menu"+id).style.backgroundRepeat = "no-repeat";
			    document.getElementById("menu"+id).style.backgroundPosition  = "0 0";
	if(id == ) {
		    document.getElementById("menu"+id).style.backgroundImage  = "url(http://energy.kaltesting.co.uk/skin/frontend/default/energy/images/a_1_bg.jpg)";
			  document.getElementById("menu"+id).style.color = "#fff";
			 }
	   else {document.getElementById("menu"+id).style.backgroundImage  = "url(http://energy.kaltesting.co.uk/skin/frontend/default/energy/images/a_2_bg.jpg)";document.getElementById("menu"+id).style.color = "#fff";}
*/

	new Effect.toggle('downloadsdetail'+id,'slide',{duration:0.7});
	new Effect.toggle('downloadsexpand'+id,'slide',{duration:0.7});
	new Effect.toggle('downloadsclosebar'+id,'slide',{duration:0.7});

	//new Element.toggle('downloadsdetail'+id);
	//new Element.toggle('downloadsexpand'+id);
	//new Element.toggle('downloadsclosebar'+id);

	if(document.getElementById('toplink'+id).className==''){

		document.getElementById('toplink'+id).className='current';

		var i=2;

		while(i<=4){

			if(i!=id){

				if(document.getElementById('downloadsexpand'+i).style.display=='none'){

					document.getElementById('toplink'+i).className='';

					new Effect.toggle ('downloadsdetail'+i,'slide',{duration:0.3});
					new Effect.toggle ('downloadsexpand'+i,'slide',{duration:0.3});
					new Effect.toggle ('downloadsclosebar'+i,'slide',{duration:0.3});

					//new Element.toggle('downloadsdetail'+i);
					//new Element.toggle('downloadsexpand'+i);
					//new Element.toggle('downloadsclosebar'+i);

				}

			}

			i++;

		}

		

	}else{

		document.getElementById('toplink'+id).className='';

	}

}



function winpop(memid) { 

  //window.open("view_images.php?model=&gid="+memid,"_blank","menubar=1,resizable=1,scrollbars=1,width=750,height=800"); 

} 



function capturepop(brochure) { 

  //window.open("/customer/main/capture_pdf.php?id="+brochure,"_blank","width=300,height=350,scrollbars=1"); 

} 



-->

</script>